-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Update CLI to show static warning for old architecture in run-windows and interactive prompt for init-windows #15038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… and interactive prompt for init-windows (#15029) * Initial plan * Initial plan: Update CLI prompt for architecture selections on old arch Co-authored-by: anupriya13 <[email protected]> * Implement interactive architecture prompt for old architecture templates Co-authored-by: anupriya13 <[email protected]> * Final implementation: Interactive architecture prompt with comprehensive testing Co-authored-by: anupriya13 <[email protected]> * Remove unintended changes from vnext/codegen directory Co-authored-by: anupriya13 <[email protected]> * Add prerelease change file for architecture prompt feature Co-authored-by: anupriya13 <[email protected]> * Replace interactive prompt with static warning for run-windows command Co-authored-by: anupriya13 <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: anupriya13 <[email protected]>
Co-Authored-By: Jon Thysell <[email protected]>
packages/@react-native-windows/cli/src/commands/runWindows/runWindows.ts
Outdated
Show resolved
Hide resolved
packages/@react-native-windows/cli/src/utils/architecturePrompt.ts
Outdated
Show resolved
Hide resolved
packages/@react-native-windows/cli/src/utils/architecturePrompt.ts
Outdated
Show resolved
Hide resolved
packages/@react-native-windows/cli/src/utils/architecturePrompt.ts
Outdated
Show resolved
Hide resolved
packages/@react-native-windows/cli/src/utils/architecturePrompt.ts
Outdated
Show resolved
Hide resolved
packages/@react-native-windows/cli/src/utils/architecturePrompt.ts
Outdated
Show resolved
Hide resolved
packages/@react-native-windows/cli/src/commands/initWindows/initWindows.ts
Outdated
Show resolved
Hide resolved
packages/@react-native-windows/cli/src/commands/initWindows/initWindows.ts
Outdated
Show resolved
Hide resolved
" I'm not sure that this is strong enough. -- It sounds like paper will no longer work in RN 0.82. -- We should probably say that using the old architecture will only work through RNW 0.81, after which it will no longer be supported. Maybe something like: " |
40e03fc
to
076d5dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the React Native Windows CLI to improve the developer experience when working with old architecture projects. It adds interactive prompts during project initialization and static warnings during project runs.
- Adds an interactive yes/no prompt in
init-windows
that allows users to switch from old architecture to new architecture - Updates
run-windows
to show a more prominent static warning for old architecture projects - Includes a
--no-prompt
flag to skip interactive prompts for automated scenarios
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
oldArchWarning.ts |
New utility for displaying consistent old architecture warnings |
architecturePrompt.ts |
New utility for prompting users about architecture choice |
initWindows.test.ts |
Test updates to validate the new --no-prompt option |
architecturePrompt.test.ts |
New test file covering the architecture prompt functionality |
runWindows.ts |
Updated to use the new warning utility instead of inline warning |
initWindowsOptions.ts |
Added noPrompt option to the interface and command options |
initWindows.ts |
Integrated the prompt logic and telemetry tracking for template changes |
Change file | Standard change file for versioning |
packages/@react-native-windows/cli/src/commands/initWindows/initWindows.ts
Show resolved
Hide resolved
packages/@react-native-windows/cli/src/e2etest/architecturePrompt.test.ts
Outdated
Show resolved
Hide resolved
packages/@react-native-windows/cli/src/commands/initWindows/initWindowsOptions.ts
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,119 @@ | |||
/** | |||
* Copyright (c) Microsoft Corporation. | |||
* Licensed under the MIT License. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disregard this review comment. The correct copyright that we use in all files is:
Copyright (c) Microsoft Corporation.
Licensed under the MIT License.
packages/@react-native-windows/cli/src/e2etest/architecturePrompt.test.ts
Outdated
Show resolved
Hide resolved
packages/@react-native-windows/cli/src/e2etest/initWindows.test.ts
Outdated
Show resolved
Hide resolved
packages/@react-native-windows/cli/src/commands/initWindows/initWindows.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
… and interactive prompt for init-windows (microsoft#15038) * Update CLI to show static warning for old architecture in run-windows and interactive prompt for init-windows (microsoft#15029) * Initial plan * Initial plan: Update CLI prompt for architecture selections on old arch Co-authored-by: anupriya13 <[email protected]> * Implement interactive architecture prompt for old architecture templates Co-authored-by: anupriya13 <[email protected]> * Final implementation: Interactive architecture prompt with comprehensive testing Co-authored-by: anupriya13 <[email protected]> * Remove unintended changes from vnext/codegen directory Co-authored-by: anupriya13 <[email protected]> * Add prerelease change file for architecture prompt feature Co-authored-by: anupriya13 <[email protected]> * Replace interactive prompt with static warning for run-windows command Co-authored-by: anupriya13 <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: anupriya13 <[email protected]> * Change files * Remove incorrect change file Co-Authored-By: Jon Thysell <[email protected]> * Address issues * add logs * nit fixes * prompt fix * Update initWindowsOptions.ts * Update initWindows.test.ts * Resolve Comments * Change files --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Jon Thysell <[email protected]>
… and interactive prompt for init-windows (#15038) (#15070) * Update CLI to show static warning for old architecture in run-windows and interactive prompt for init-windows (#15029) * Initial plan * Initial plan: Update CLI prompt for architecture selections on old arch * Implement interactive architecture prompt for old architecture templates * Final implementation: Interactive architecture prompt with comprehensive testing * Remove unintended changes from vnext/codegen directory * Add prerelease change file for architecture prompt feature * Replace interactive prompt with static warning for run-windows command --------- * Change files * Remove incorrect change file * Address issues * add logs * nit fixes * prompt fix * Update initWindowsOptions.ts * Update initWindows.test.ts * Resolve Comments * Change files --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Jon Thysell <[email protected]>
Description
Type of Change
Why
What is the motivation for this change? Add a few sentences describing the context and overall goals of the pull request's commits.
Resolves #15027
What
What changes were made to the codebase to solve the bug, add the functionality, etc. that you specified above.
Adds a yes/no prompt in init-windows and if user wants new arch then will switch to that instead.
Screenshots
Add any relevant screen captures here from before or after your changes.
init-windows with No
init-windows with Yes
Testing
If you added tests that prove your changes are effective or that your feature works, add a few sentences here detailing the added test scenarios.
Optional: Describe the tests that you ran locally to verify your changes.
Tested locally
Recording.2025-08-14.181124.mp4
Other Cases:
1. old/uwp-cpp-app
2. old/uwp-cs-app
3. cpp-app
4. cpp-lib
5. --no-prompt
Changelog
Should this change be included in the release notes: yes
Add a brief summary of the change to use in the release notes for the next release.